-
Notifications
You must be signed in to change notification settings - Fork 29
Adds DateTime Extension Support #328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds DateTime Extension Support #328
Conversation
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
| /** Convert DateTime to Cedar expr that can be used in a Cedar policy. */ | ||
| @Override | ||
| public String toCedarExpr() { | ||
| return "datetime(\"" + dateTime + "\")"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worried about this being valid, but should be fine since dateTime is validated on construction, cannot be mutated externally since it's private and it's set once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. It's final and only assigned after validation so should be ok. This is what we do for IpAddress as well
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
mark-creamer-amazon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
shaobo-he-aws
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Overview
Adds DateTime Extension Support (RFC 80)
Changes
Implements new
com.cedarpolicy.value.DateTimeclassDateTimevalue inStringrepresentationIntegrates
DateTimesupport in serialization layerValueSerializerto handleDateTimeserializationDateTimedeserialization support inValueDeserializerTesting
DateTimevalidation, serialization, and edge casesDateTimefunctionalityUpdates CHANGELOG
Example Usage